<template>
          <div>
                <header>
                     <i class="iconfont icon-weibiaoti-- fh" @click="back" ></i>
                     <span class="title">产品详情</span>
               </header>
               <h1 style="width:100%;height:1.88rem;"></h1>
               <div v-html="jg"></div>
          </div>
</template>

<script>
export default {
	     data(){
	     	return {
	     		 jg:"",
	     	}
	     },
        methods:{
            back(){
                this.$router.go(-1)
            }
        },
        mounted(){
            var userInfo = JSON.parse(localStorage.getItem('userInfo'))
               if(!userInfo){
                   this.$router.push({name:'login'})
               }else{
                  
               }
            var id = this.$route.params.id
//          console.log(id)
            this.$http.get('/api/index/product')
                .then(res=>{
//              	console.log(res)
                	    var data = res.data.data
                     for(let i=0;i<data.length;i++){
                     	  if(data[i].id==id){
                     	  	 //console.log(id)
                     	  	  this.jg = data[i].detail
                     	  }
                     }
                })
        }
}
</script>

<style lang="less" scoped>
        header{
               position:fixed;
               top:0;
               width:100%;
               height:1.88rem;
               display:flex;
               position: fixed;
               top:0;
               z-index:100;
               background: #fff;
         }
         .fh{
             width:2.1rem;
             line-height:1.88rem;
             text-align:center;
             z-index:100; 
             color:#333333;
             font-size:0.76rem;  
         }
         .title{
               font-size:0.76rem;
               line-height:1.88rem;
               text-align:center;
               color:#333333;
               letter-spacing:0.02rem;
               position: absolute;
               left:0;
               right:0;
               margin:0 auto;
         }
</style>

